package com.shunt.controller;

import com.shunt.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by liang on 2017/11/24.
 */
@Controller
public class BaseController {

	@Autowired
	private BaseService baseService;

	@RequestMapping(value = "/index",method = RequestMethod.GET)
	public String index(){
		return "index";
	}

	@ResponseBody
	@RequestMapping(value = "/name",method = RequestMethod.GET)
	public String name(@RequestParam(value = "id") int id){
		return baseService.getName(id);
	}
}
